import java.util.HashMap;
import java.util.Map;

/**
 * @author gaopeng
 * @date 2019/12/21 8:08 下午
 */
public class SignInfoFactory {
    private static Map<String,SignInfo> pool = new HashMap<>();
    public static SignInfo getSignInfo(String key){
        SignInfo result;
        if(pool.containsKey(key)){
            result = pool.get(key);
            System.out.println("直接获取对象。");
        }else{
            result = new SignInfoPool(key);
            pool.put(key,result);
            System.out.println("创建对象");
        }
        return result;
    }
}
